#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
struct S1
{
	char c1;
	int i;
	char c2;
};


struct S2
{
	char c1;
	char c2;
	int i;
};

struct A
{
	int _a : 2;
	int _b : 5;
	int _c : 10;
	int _d : 30;
};

//联合类型的声明
union Un
{
	char c;
	int i;
};


union Un1
{
	char c[5];
	int i;
};
union Un2
{
	short c[7];
	int i;
};

int main()
{
	//printf("%d\n", sizeof(struct S1));
	//printf("%d\n", sizeof(struct S2));
	//printf("%d\n", sizeof(struct A));
	//联合变量的定义
	//union Un un;
	////计算连个变量的大小
	//printf("%d\n", sizeof(un));
	//下面输出的结果是什么？
	printf("%d\n", sizeof(union Un1));
	printf("%d\n", sizeof(union Un2));
}